define(function (require, exports) { 'use strict'; var angular, commonHeaders; angular = require('base').ng; commonHeaders = { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded;', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0' }; //@ngInject exports.LoginService = function ($http, lpCoreUtils) { var config = {}; return { setup: function (localConfig) { config = angular.extend(config, localConfig); return this; }, checkCustomer: function (data) { return $http({ method: 'POST', url: config.checkCustomerExistEndpoint, data: lpCoreUtils.buildQueryString(data), headers: commonHeaders }); }, preLoginChk: function (data) { return $http({ method: 'POST', url: config.profileChkEndpoint, data: lpCoreUtils.buildQueryString(data), headers: commonHeaders }); }, generateOTP: function (data) { return $http({ method: 'POST', url: config.generateOTPEndpoint, data: lpCoreUtils.buildQueryString(data), headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded;' } }); }, verifyLoginRSA: function (data) { return $http({ method: 'POST', url: config.verifyRsaLoginEndpoint, data: lpCoreUtils.buildQueryString(data), headers: commonHeaders }); }, analyzeRSA: function (data) { return $http({ method: 'POST', url: config.rsaAnalyzeEndpoint, data: lpCoreUtils.buildQueryString(data), headers: commonHeaders }); }, emudra: function () { return $http({ method: 'GET', url: config.emudraEndpoint, headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded;' } }); }, login: function (data) { return $http({ method: 'POST', url: config.loginEndpoint + '?rd=' + new Date().getTime(), data: lpCoreUtils.buildQueryString(data), headers: commonHeaders }); }, lockSMS: function () { return $http({ method: 'GET', url: config.lockSMSEndpoint, headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded;' } }); }, notifyLoginFailRSA: function (data) { return $http({ method: 'POST', url: config.rsaLoginFailNotifyEndpoint, data: lpCoreUtils.buildQueryString(data), headers: commonHeaders }); }, getSessionValidateService: function () { return $http({ method: 'GET', url: config.sessValidateServiceEndpoint, data: config.data, headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded;' } }) }, getGroup: function (url) { return $http({ method: 'GET', url: url+ '?rd=' + new Date().getTime(), headers: commonHeaders }); }, mailExistService: function() { return $http({ method: 'POST', url: config.mailExist, headers: commonHeaders }); }, generateOTPLoginService: function() { return $http({ method: 'POST', url: config.generateOTPLogin, data: config.data, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' } }); }, verifyOTPLoginService: function() { return $http({ method: 'POST', url: config.verifyOTPLogin, data: config.data, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' } }); } }; }; });